import time
import functools
def clock(func):
    # @functools.wraps(func)
    def clocked(*args):
        t0 = time.perf_counter()
        result = func(*args)
        elapsed = time.perf_counter() - t0
        print('cost %0.8fs %s ->%r' %(elapsed, func.__name__, result))
        return result
    return clocked

@functools.lru_cache(maxsize=128, typed=False)
@clock
def snooze(seconds):
    time.sleep(seconds)

if __name__ == '__main__':
    snooze(.5)
    print(snooze.__name__)